﻿angular.module('angle').config([
    '$stateProvider', '$locationProvider', '$urlRouterProvider', 'RouteHelpersProvider',
    function ($stateProvider, $locationProvider, $urlRouterProvider, helper) {
        'use strict';

        // Set the following to true to enable the HTML5 Mode
        // You may have to set <base> tag in index and a routing configuration in your server
        $locationProvider.html5Mode(false);
        //$urlRouterProvider

        //// The `when` method says if the url is ever the 1st param, then redirect to the 2nd param
        //// Here we are just setting up some convenience urls.
        //.when('/c?id', '/contacts/:id')
        //.when('/user/:id', '/contacts/:id')

        //// If the url is ever invalid, e.g. '/asdf', then redirect to '/' aka the home state
        //.otherwise('/');
        // defaults to dashboard
        $urlRouterProvider.otherwise('/shop/');

        // 
        // Application Routes
        // -----------------------------------   
        $stateProvider
                 //.state('shopindex', {
                 //    url: '/',
                 //    title: '店铺首页',
                 //    templateUrl: '/Views/shop.html'
                 //})
            .state('message', {
                url: '/message',
                title: '温馨提示',
                controller: [
                    "$scope", "$stateParams", function ($scope, $stateParams) {
                        $scope.Message = $stateParams.msg;
                    }
                ],
                params: { msg: '' },
                templateUrl: helper.basepath('Message.html')
            })
            .state('404', {
                url: '/404',
                title: '抱歉，系统繁忙',
                templateUrl: helper.basepath('404.html')
            })
        ;


    }])